package edu.zust.zw.shop;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;

import edu.zust.zw.shop.interceptor.CrossHandlerInterceptor;
import edu.zust.zw.shop.interceptor.LoginIntercepter;

@Configuration
public class InterceptorConfig extends WebMvcConfigurerAdapter{

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        // TODO Auto-generated method stub
     //   跨域拦截器
     //   registry.addInterceptor(new CrossHandlerInterceptor()).addPathPatterns("/**");
        registry.addInterceptor(new LoginIntercepter()).addPathPatterns("/**").excludePathPatterns("/login/*").excludePathPatterns("/test/*");
        super.addInterceptors(registry);
    }
}
